package com.umgsai.thread.thread02;

import java.util.Random;

public class MyThread2 extends Thread {
	@Override
	public void run() {
		long beginTime = System.currentTimeMillis();
		long result = 0;
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j< 50000; j++) {
				Random random = new Random();
				random.nextInt();
				result = result + j;
			}
		}
		long endTime = System.currentTimeMillis();
		System.out.println("★★★★★-" + (endTime - beginTime));
	}
	
	public static void main(String[] args) {
		for (int i = 0; i < 30; i++) {
			MyThread1 t1 = new MyThread1();
			t1.setPriority(5);
			t1.start();
			
			MyThread2 t2 = new MyThread2();
			t2.setPriority(6);
			t2.start();
		}
	}
}
